home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume12 / postscript / part01 next >
Encoding:
Internet Message Format  |  1987-10-27  |  60.8 KB

  1. Subject:  v12i050:  A PostScript(tm) interpreter, Part01/18
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rs@uunet.UU.NET
  5.  
  6. Submitted-by: Crispin Goswell <caag@vd.rl.ac.uk>
  7. Posting-number: Volume 12, Issue 50
  8. Archive-name: postscript/part01
  9.  
  10. This is a virtually complete implementation of PostScript.  Just type
  11. make and it should produce a version for suns.  Since the only complete
  12. driver is for suns and since some driver writing will be necessary on
  13. any other machine, I have not packaged everything up in an idiot-proof
  14. box.  I am not aware of any Gotchas in building this source.  The X
  15. driver used to work on X10 - It will need work for X11.  The pixrect
  16. driver is very new, and should be regarded as didactic, as it scribbles
  17. straight onto the display.  Persuading suntools to look after the bits
  18. would have taken too long.
  19.  
  20. Writing your own driver involves merely hacking pixrect.c until it will
  21. drive your display.  There are only 11 routines to write, and they're
  22. all quite short.
  23.  
  24. Have fun!
  25.  
  26. - Crispin Goswell
  27.  
  28. caag@uk.ac.rl.vd    (JANET)
  29. caag@vd.rl.ac.uk    (Internet)
  30. ...!mcvax!ukc!rlvd!caag    (UUCP)
  31.  
  32. #! /bin/sh
  33. # This is a shell archive.  Remove anything before this line, then unpack
  34. # it by saving it into a file and typing "sh file".  To overwrite existing
  35. # files, type "sh file -c".  You can also feed this as standard input via
  36. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  37. # will see the following message at the end:
  38. #        "End of archive 1 (of 18)."
  39. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  40. if test -f 'INSTALLATION' -a "${1}" != "-c" ; then 
  41.   echo shar: Will not clobber existing file \"'INSTALLATION'\"
  42. else
  43. echo shar: Extracting \"'INSTALLATION'\" \(1880 characters\)
  44. sed "s/^X//" >'INSTALLATION' <<'END_OF_FILE'
  45. X
  46. XNote that is necessary to run a shell with job-control (e.g. csh) on
  47. Xthe sun3 version when using PS, because of process-group problems with
  48. Xsuntools. It is also difficult to alter the window shape when PS is
  49. Xdoing output on suns. If the postscript/viewer pair are used, these
  50. Xproblems are not encountered, but it runs more slowly.
  51. X
  52. XTo try it out, type the following:
  53. X    $ POSTSCRIPTLIB=<where ever the postscript directory is>/postscript
  54. X    $ export POSTSCRIPTLIB
  55. X    $ PS -c 'A4 (demos/wow) lib run'
  56. X    $ 
  57. X
  58. XThe "showpage" operator expects a carriage return before it erases the
  59. Xpage and allows output to continue (or in this case for PS to
  60. Xterminate).  More generally, use:
  61. X
  62. X    $ PS -c A4 [ files .... ]
  63. X    $ 
  64. X
  65. XThe A4 command is shorthand for a framedevice command (see the
  66. Xpostscript reference manual) to create an A4 sized window. It is
  67. Xsupposed to be actual size, except on suns, where the screen is not big
  68. Xenough (!)
  69. X
  70. XIt also works on the perq, but much more slowly.
  71. X
  72. XIf PostScript is not to be fully installed, the environment variable
  73. XPOSTSCRIPTLIB may be set to the pathname of /usr/lib/postscript.
  74. XAlternatively, config.c has a variable called default_library[], which
  75. Xmay be changed to point somewhere else.
  76. X    
  77. XThe tape contains:
  78. X
  79. XINSTALLATION     which you are reading
  80. X
  81. Xsource        - complete sources
  82. X
  83. Xpostscript    - various files the interpreter needs to run.
  84. X      /font        - font descriptors
  85. X      /fonts    - font data
  86. X          hershey fonts (yuk) all we have available at present,
  87. X          however there are instructions on how to add fonts in
  88. X          the file "adding-fonts".
  89. X      /psrc        - initialisation file ('rc' file).
  90. X      /cache    - disk cache of popular font sizes
  91. X      /font-map    - mapping from postscript names to names in font
  92. X      /demos - demos programs other than those in the cookbook
  93. X
  94. Xdoc   - documents of interest to people installing postscript, particularly
  95. X    postscript.1    - manual entry for postscript
  96. END_OF_FILE
  97. if test 1880 -ne `wc -c <'INSTALLATION'`; then
  98.     echo shar: \"'INSTALLATION'\" unpacked with wrong size!
  99. fi
  100. # end of 'INSTALLATION'
  101. fi
  102. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  103.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  104. else
  105. echo shar: Extracting \"'MANIFEST'\" \(4640 characters\)
  106. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  107. X   File Name        Archive #    Description
  108. X-----------------------------------------------------------
  109. X INSTALLATION              1    
  110. X MANIFEST                  1    
  111. X binaries                  1    
  112. X binaries/pnx5             1    
  113. X binaries/pyramid          1    
  114. X binaries/sun2             1    
  115. X binaries/sun3             1    
  116. X binaries/vax              1    
  117. X doc                       1    
  118. X doc/adding-fonts          1    
  119. X doc/byte-stream           2    
  120. X doc/hard-interface        5    
  121. X doc/hard-interface.c      7    
  122. X doc/postscript.1          3    
  123. X postscript                1    
  124. X postscript/demos          1    
  125. X postscript/demos/dashcorner 1    
  126. X postscript/demos/fishes   5    
  127. X postscript/demos/gks      1    
  128. X postscript/demos/grayscale 1    
  129. X postscript/demos/hughes   1    
  130. X postscript/demos/it       1    
  131. X postscript/demos/mooreform.ps 3    
  132. X postscript/demos/newscreen.ps 1    
  133. X postscript/demos/raygun2 18    
  134. X postscript/demos/rosette  1    
  135. X postscript/demos/tree.ps  1    
  136. X postscript/demos/wow      1    
  137. X postscript/demos/wow2     1    
  138. X postscript/demos/wow3     1    
  139. X postscript/font           1    
  140. X postscript/font-map       1    
  141. X postscript/font/Helvetica 1    
  142. X postscript/font/Helvetica-Ob 1    
  143. X postscript/font/Times-BI  1    
  144. X postscript/font/Times-Bold 1    
  145. X postscript/font/Times-Italic 1    
  146. X postscript/font/Times-Roman 1    
  147. X postscript/font/Times-Roman-Adobe 1    
  148. X postscript/font/proforma  1    
  149. X postscript/fonts          1    
  150. X postscript/fonts/Gothic   1    
  151. X postscript/fonts/Gothic/roman.r10    
  152. X postscript/fonts/Olde     1    
  153. X postscript/fonts/Olde/italic.r14    
  154. X postscript/fonts/Olde/roman.r16    
  155. X postscript/fonts/SANS     1    
  156. X postscript/fonts/SANS/italic.r13    
  157. X postscript/fonts/SANS/roman.r13    
  158. X postscript/fonts/Sans     1    
  159. X postscript/fonts/Sans/greek.r 3    
  160. X postscript/fonts/Sans/italic.r 7    
  161. X postscript/fonts/Sans/roman.r17    
  162. X postscript/fonts/TIMES    1    
  163. X postscript/fonts/TIMES/italic.r15    
  164. X postscript/fonts/TIMES/roman.r15    
  165. X postscript/fonts/Times    1    
  166. X postscript/fonts/Times/bits.r11    
  167. X postscript/fonts/Times/greek.r 6    
  168. X postscript/fonts/Times/italic 1    
  169. X postscript/fonts/Times/italic.a 5    
  170. X postscript/fonts/Times/italic.r 8    
  171. X postscript/fonts/Times/rest.r 4    
  172. X postscript/fonts/Times/roman 1    
  173. X postscript/fonts/Times/roman.a 5    
  174. X postscript/fonts/Times/roman.r 6    
  175. X postscript/fonts/Times/russian.r 9    
  176. X postscript/fonts/extra    1    
  177. X postscript/fonts/extra/extra.r11    
  178. X postscript/fonts/sans     1    
  179. X postscript/fonts/sans/greek.r 1    
  180. X postscript/fonts/sans/roman.r 3    
  181. X postscript/fonts/times    1    
  182. X postscript/fonts/times/greek.r 5    
  183. X postscript/fonts/times/italic.r 7    
  184. X postscript/fonts/times/roman.r16    
  185. X postscript/psrc          10    
  186. X postscript/widths         1    
  187. X postscript/widths/Adobe   1    
  188. X postscript/widths/Adobe/Times-Roman 3    
  189. X source                    1    
  190. X source/README             1    
  191. X source/X.c               12    
  192. X source/adapter.c          4    
  193. X source/array.c            7    
  194. X source/boolean.c          2    
  195. X source/cache.c           12    
  196. X source/canon.c            1    
  197. X source/canon.h            1    
  198. X source/colour-ww.c        6    
  199. X source/colour.c           2    
  200. X source/colour.h           1    
  201. X source/config.c           2    
  202. X source/control.c          4    
  203. X source/copyright.h        1    
  204. X source/device.c           5    
  205. X source/device.h           1    
  206. X source/dictionary.c      10    
  207. X source/file.c            14    
  208. X source/fill.c            12    
  209. X source/font.c            13    
  210. X source/font.h             1    
  211. X source/graphics.h         1    
  212. X source/gsave.c            2    
  213. X source/hard-interface.c   8    
  214. X source/hard.h             1    
  215. X source/head               1    
  216. X source/head.ed            1    
  217. X source/image.c            9    
  218. X source/integer.c          6    
  219. X source/main.c             8    
  220. X source/main.h             2    
  221. X source/makefile           1    
  222. X source/malloc.c           1    
  223. X source/mat.c              2    
  224. X source/mat.h              1    
  225. X source/math.c             3    
  226. X source/matrix.c           8    
  227. X source/misc.c             1    
  228. X source/name.c             2    
  229. X source/null.c             1    
  230. X source/operator.c         6    
  231. X source/orion.c            4    
  232. X source/paint.c            3    
  233. X source/pat.c             10    
  234. X source/path.c             8    
  235. X source/path.h             1    
  236. X source/pixrect.c          3    
  237. X source/point.h            1    
  238. X source/poly.c             2    
  239. X source/property.c         2    
  240. X source/protocol.c         2    
  241. X source/protocol.h         1    
  242. X source/real.c             4    
  243. X source/rop.h              1    
  244. X source/save.c             1    
  245. X source/screen.c           2    
  246. X source/stack.c            4    
  247. X source/state.c            9    
  248. X source/str.h              1    
  249. X source/string.c          11    
  250. X source/stroke.c           9    
  251. X source/trapezoid.c        1    
  252. X source/unix.c             2    
  253. X source/viewer.c           7    
  254. X source/ww.c               4    
  255. END_OF_FILE
  256. if test 4640 -ne `wc -c <'MANIFEST'`; then
  257.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  258. fi
  259. # end of 'MANIFEST'
  260. fi
  261. if test ! -d 'binaries' ; then
  262.     echo shar: Creating directory \"'binaries'\"
  263.     mkdir 'binaries'
  264. fi
  265. if test ! -d 'binaries/pnx5' ; then
  266.     echo shar: Creating directory \"'binaries/pnx5'\"
  267.     mkdir 'binaries/pnx5'
  268. fi
  269. if test ! -d 'binaries/pyramid' ; then
  270.     echo shar: Creating directory \"'binaries/pyramid'\"
  271.     mkdir 'binaries/pyramid'
  272. fi
  273. if test ! -d 'binaries/sun2' ; then
  274.     echo shar: Creating directory \"'binaries/sun2'\"
  275.     mkdir 'binaries/sun2'
  276. fi
  277. if test ! -d 'binaries/sun3' ; then
  278.     echo shar: Creating directory \"'binaries/sun3'\"
  279.     mkdir 'binaries/sun3'
  280. fi
  281. if test ! -d 'binaries/vax' ; then
  282.     echo shar: Creating directory \"'binaries/vax'\"
  283.     mkdir 'binaries/vax'
  284. fi
  285. if test ! -d 'doc' ; then
  286.     echo shar: Creating directory \"'doc'\"
  287.     mkdir 'doc'
  288. fi
  289. if test -f 'doc/adding-fonts' -a "${1}" != "-c" ; then 
  290.   echo shar: Will not clobber existing file \"'doc/adding-fonts'\"
  291. else
  292. echo shar: Extracting \"'doc/adding-fonts'\" \(1849 characters\)
  293. sed "s/^X//" >'doc/adding-fonts' <<'END_OF_FILE'
  294. XFonts may be added to this postscript system by placing a piece of
  295. XPostScript source in the directory $POSTSCRIPTLIB/font.  This is where
  296. Xpostscript looks when findfont is called. File names in this directory
  297. Xmay be mapped from font names by placing entries of the form:
  298. X    FontMap /postscript-name /base-file-name. put
  299. Xin the font-map file in $POSTSCRIPTLIB.
  300. X
  301. XIf postscript-name is not found there, an identity mapping is assumed.
  302. X
  303. XThe existing fonts are similarly structured, so most of the work is
  304. Xdone by executing a common proforma file in that directory. This sets
  305. Xup the appropriate font information.  A version of BuildChar is
  306. Xinstalled which will read in the bulk of the font infromation when it
  307. Xis first executed. It will then replace itself with the normal
  308. XBuildChar.
  309. X
  310. XNOTE the metrics are currently loaded with the rest of the font
  311. Xinformation on demand, so programs which attempt to read metric
  312. Xinfromation before using a font will fail. This is a bug, but can be
  313. Xfixed in PostScript.
  314. X
  315. XThere is a parallel cache directory, $POSTSCRIPTLIB/cache. This
  316. Xcontains a directory corresponding to each file in $POSTSCRIPT/font,
  317. Xinto which cached versions of fonts may be placed. The operator
  318. Xsavecurrentfont may be called after imaging some characters from a
  319. Xfont, whereupon a diskcache will be made of the characters imaged so
  320. Xfar. Caches loaded may be subsequently modified and saved, thus built
  321. Xincrementally.  There should be an operator to save all modified caches
  322. Xinto the disk cache. This could be built into PostScript, but might
  323. Xcause problems.  There is a program called buildcache in the demos
  324. Xdirectory which will build a cache of the standard fonts in a variety
  325. Xof useful sizes.
  326. X
  327. XPostScript searches the disk cache automatically, and will not call BuildChar if it find a cache.
  328. XThis version of the cache stores metrics for the font.
  329. X
  330. END_OF_FILE
  331. if test 1849 -ne `wc -c <'doc/adding-fonts'`; then
  332.     echo shar: \"'doc/adding-fonts'\" unpacked with wrong size!
  333. fi
  334. # end of 'doc/adding-fonts'
  335. fi
  336. if test ! -d 'postscript' ; then
  337.     echo shar: Creating directory \"'postscript'\"
  338.     mkdir 'postscript'
  339. fi
  340. if test ! -d 'postscript/demos' ; then
  341.     echo shar: Creating directory \"'postscript/demos'\"
  342.     mkdir 'postscript/demos'
  343. fi
  344. if test -f 'postscript/demos/dashcorner' -a "${1}" != "-c" ; then 
  345.   echo shar: Will not clobber existing file \"'postscript/demos/dashcorner'\"
  346. else
  347. echo shar: Extracting \"'postscript/demos/dashcorner'\" \(120 characters\)
  348. sed "s/^X//" >'postscript/demos/dashcorner' <<'END_OF_FILE'
  349. X[10 90] 5 setdash 30 setlinewidth
  350. Xnewpath 0 0 moveto 100 0 lineto 100 100 lineto 0 100 lineto closepath stroke
  351. Xshowpage
  352. END_OF_FILE
  353. if test 120 -ne `wc -c <'postscript/demos/dashcorner'`; then
  354.     echo shar: \"'postscript/demos/dashcorner'\" unpacked with wrong size!
  355. fi
  356. # end of 'postscript/demos/dashcorner'
  357. fi
  358. if test -f 'postscript/demos/gks' -a "${1}" != "-c" ; then 
  359.   echo shar: Will not clobber existing file \"'postscript/demos/gks'\"
  360. else
  361. echo shar: Extracting \"'postscript/demos/gks'\" \(629 characters\)
  362. sed "s/^X//" >'postscript/demos/gks' <<'END_OF_FILE'
  363. X%!
  364. Xsave
  365. X100 setflat
  366. X/Courier findfont 400 scalefont setfont
  367. X
  368. X300 0 translate 90 rotate
  369. X
  370. X/track { dup
  371. X    0 0 moveto false charpath 30 setlinewidth strokepath
  372. X    0 setgray 5 setlinewidth stroke
  373. X    0 0 moveto false charpath 30 setlinewidth strokepath
  374. X    .3 setgray 2.5 setlinewidth stroke
  375. X} def
  376. X
  377. X6 array currentmatrix
  378. X
  379. X(G) track (G) stringwidth translate
  380. X(K) track (K) stringwidth translate
  381. X(S) track (S) stringwidth translate
  382. X
  383. Xsetmatrix
  384. X
  385. X/rude (Eat your heart out!) def
  386. X
  387. X/Times-Roman findfont 100 scalefont setfont
  388. X
  389. X.3 setgray
  390. X
  391. Xclippath pathbbox pop exch pop exch sub rude stringwidth pop sub 2 div -150 moveto rude show
  392. X
  393. Xshowpage
  394. Xrestore
  395. END_OF_FILE
  396. if test 629 -ne `wc -c <'postscript/demos/gks'`; then
  397.     echo shar: \"'postscript/demos/gks'\" unpacked with wrong size!
  398. fi
  399. # end of 'postscript/demos/gks'
  400. fi
  401. if test -f 'postscript/demos/grayscale' -a "${1}" != "-c" ; then 
  402.   echo shar: Will not clobber existing file \"'postscript/demos/grayscale'\"
  403. else
  404. echo shar: Extracting \"'postscript/demos/grayscale'\" \(255 characters\)
  405. sed "s/^X//" >'postscript/demos/grayscale' <<'END_OF_FILE'
  406. Xinitgraphics
  407. Xclippath pathbbox pop exch pop 2 copy exch sub /range exch def
  408. X/step range 50.0 div def
  409. X0 200 translate
  410. Xnewpath
  411. Xstep exch {
  412. X    dup range div setgray
  413. X    0 0 moveto step 0 lineto step 100 lineto 0 100 lineto closepath
  414. X    fill
  415. X    step 0 translate
  416. X} for
  417. END_OF_FILE
  418. if test 255 -ne `wc -c <'postscript/demos/grayscale'`; then
  419.     echo shar: \"'postscript/demos/grayscale'\" unpacked with wrong size!
  420. fi
  421. # end of 'postscript/demos/grayscale'
  422. fi
  423. if test -f 'postscript/demos/hughes' -a "${1}" != "-c" ; then 
  424.   echo shar: Will not clobber existing file \"'postscript/demos/hughes'\"
  425. else
  426. echo shar: Extracting \"'postscript/demos/hughes'\" \(1300 characters\)
  427. sed "s/^X//" >'postscript/demos/hughes' <<'END_OF_FILE'
  428. X%!
  429. X70 9.3 72 mul translate
  430. X
  431. X/basic 18 def
  432. X
  433. X/large /Times-Roman findfont basic 2 mul scalefont def
  434. X/normal /Times-Roman findfont basic scalefont def
  435. X/italic /Times-Italic findfont basic scalefont def
  436. X
  437. X/down { 0 basic neg rmoveto } def
  438. X
  439. X/p { normal setfont show } def
  440. X/i { italic setfont show } def
  441. X/d { italic setfont 72 0 rmoveto (Death.) show } def
  442. X/n { currentpoint exch pop 0 exch moveto down } def
  443. X
  444. X0 0 moveto
  445. Xdown down down
  446. X
  447. X(Examination at the Womb-Door) large setfont show down n
  448. X
  449. X(Who owns these scrawny little feet?) p d n
  450. X(Who owns this bristly scorched-looking face?) p d n
  451. X(Who owns these still-working lungs?) p d n
  452. X(Who owns this utility coat of muscles?) p d n
  453. X(Who owns these unspeakable guts?) p d n
  454. X(Who owns these questionable brains?) p d n
  455. X(All this messy blood?) p d n
  456. X(These minimum-efficiency eyes?) p d n
  457. X(This wicked little tongue?) p d n
  458. X(This occasional wakefulness?) p d n
  459. X n
  460. X(Given, stolen or held pending trial?) p n
  461. X(Held.) i n
  462. X n
  463. X(Who owns the whole rainy, stony earth?) p d n
  464. X(Who owns all of space?) p d n
  465. Xn
  466. X(Who is stronger than hope?) p d n
  467. X(Who is stronger than the will?) p d n
  468. X(Stronger than love?) p d n
  469. X(Stronger than life?) p d n
  470. Xn
  471. X/but (But who is stronger than death?) def but p n
  472. Xbut stringwidth rmoveto (Me, evidently.) i n
  473. Xn
  474. X(Pass, Crow.) p n
  475. Xshowpage
  476. END_OF_FILE
  477. if test 1300 -ne `wc -c <'postscript/demos/hughes'`; then
  478.     echo shar: \"'postscript/demos/hughes'\" unpacked with wrong size!
  479. fi
  480. # end of 'postscript/demos/hughes'
  481. fi
  482. if test -f 'postscript/demos/it' -a "${1}" != "-c" ; then 
  483.   echo shar: Will not clobber existing file \"'postscript/demos/it'\"
  484. else
  485. echo shar: Extracting \"'postscript/demos/it'\" \(319 characters\)
  486. sed "s/^X//" >'postscript/demos/it' <<'END_OF_FILE'
  487. X%!
  488. X300 300 translate 0 setgray
  489. X12 {
  490. X    0 0 moveto 200 0 rlineto 0 200 rlineto -200 0 rlineto closepath
  491. X    25 25 moveto 0 150 rlineto 150 0 rlineto 0 -150 rlineto closepath
  492. X    125 100 moveto 100 100 25 0 360 arc closepath
  493. X    gsave fill grestore
  494. X    currentgray
  495. X        0 setgray stroke
  496. X    1 12 div add setgray
  497. X    30 rotate
  498. X} repeat
  499. Xshowpage
  500. END_OF_FILE
  501. if test 319 -ne `wc -c <'postscript/demos/it'`; then
  502.     echo shar: \"'postscript/demos/it'\" unpacked with wrong size!
  503. fi
  504. # end of 'postscript/demos/it'
  505. fi
  506. if test -f 'postscript/demos/newscreen.ps' -a "${1}" != "-c" ; then 
  507.   echo shar: Will not clobber existing file \"'postscript/demos/newscreen.ps'\"
  508. else
  509. echo shar: Extracting \"'postscript/demos/newscreen.ps'\" \(319 characters\)
  510. sed "s/^X//" >'postscript/demos/newscreen.ps' <<'END_OF_FILE'
  511. X%!
  512. X
  513. X/scr [ [43 11 35 3 41 9 33 1] [27 59 19 51 25 57 17 49] [39 7 47 15 37 5 45 13] [23 55 31 63 21 53 29 61] [42 10 34 2 44 12 36 4] [26 58 18 50 28 60 20 52] [38 6 46 14 40 8 48 16] [22 54 30 62 24 56 32 64] ]def
  514. X
  515. X82 8 idiv 0.0 { 1 add 4 mul cvi exch 1 add 4 mul cvi scr exch get exch get 33.0 sub 32 div } setscreen
  516. END_OF_FILE
  517. if test 319 -ne `wc -c <'postscript/demos/newscreen.ps'`; then
  518.     echo shar: \"'postscript/demos/newscreen.ps'\" unpacked with wrong size!
  519. fi
  520. # end of 'postscript/demos/newscreen.ps'
  521. fi
  522. if test -f 'postscript/demos/rosette' -a "${1}" != "-c" ; then 
  523.   echo shar: Will not clobber existing file \"'postscript/demos/rosette'\"
  524. else
  525. echo shar: Extracting \"'postscript/demos/rosette'\" \(436 characters\)
  526. sed "s/^X//" >'postscript/demos/rosette' <<'END_OF_FILE'
  527. X/inch {72 mul} def
  528. X
  529. X/wedge {
  530. X    newpath 0 0 moveto 1 0 translate 15 rotate 0 15 sin translate
  531. X    0 0 15 sin -90 90 arc closepath
  532. X} def
  533. X
  534. Xgsave
  535. X    3.75 inch 7.25 inch translate
  536. X    1 inch 1 inch scale
  537. X    wedge .02 setlinewidth stroke
  538. Xgrestore
  539. X
  540. Xgsave
  541. X    4.25 inch 4.25 inch translate
  542. X    1.75 inch 1.75 inch scale
  543. X    .02 setlinewidth
  544. X    2 1 13 {
  545. X        13 div setgray
  546. X        gsave
  547. X            wedge gsave fill grestore
  548. X            0 setgray stroke
  549. X        grestore
  550. X        30 rotate
  551. X    } for
  552. Xgrestore
  553. END_OF_FILE
  554. if test 436 -ne `wc -c <'postscript/demos/rosette'`; then
  555.     echo shar: \"'postscript/demos/rosette'\" unpacked with wrong size!
  556. fi
  557. # end of 'postscript/demos/rosette'
  558. fi
  559. if test -f 'postscript/demos/tree.ps' -a "${1}" != "-c" ; then 
  560.   echo shar: Will not clobber existing file \"'postscript/demos/tree.ps'\"
  561. else
  562. echo shar: Extracting \"'postscript/demos/tree.ps'\" \(594 characters\)
  563. sed "s/^X//" >'postscript/demos/tree.ps' <<'END_OF_FILE'
  564. X%!
  565. X
  566. X/Times-Roman findfont setfont
  567. X
  568. X%/go { translate 0 0 moveto } def
  569. X/size 0 4 dtransform dup mul exch dup mul add def
  570. X
  571. X/tree {
  572. X     0 0 moveto (T) show
  573. X     0 1 dtransform
  574. X      dup mul exch dup mul add
  575. X      size gt
  576. X         {
  577. X          currentpoint translate
  578. X          0 .1 translate 0.6 0.6 scale
  579. X          0 0 moveto (R) show
  580. X          currentpoint translate
  581. X          .75 0 translate
  582. X      gsave
  583. X        90 rotate tree
  584. X      grestore
  585. X      .75 0 translate
  586. X      90 rotate -1 1 scale
  587. X      (T) stringwidth neg exch neg exch translate
  588. X      tree
  589. X      } if
  590. X  } def
  591. X
  592. X100 400 translate 200 200 scale
  593. X
  594. Xtree
  595. Xshowpage
  596. X
  597. END_OF_FILE
  598. if test 594 -ne `wc -c <'postscript/demos/tree.ps'`; then
  599.     echo shar: \"'postscript/demos/tree.ps'\" unpacked with wrong size!
  600. fi
  601. # end of 'postscript/demos/tree.ps'
  602. fi
  603. if test -f 'postscript/demos/wow' -a "${1}" != "-c" ; then 
  604.   echo shar: Will not clobber existing file \"'postscript/demos/wow'\"
  605. else
  606. echo shar: Extracting \"'postscript/demos/wow'\" \(262 characters\)
  607. sed "s/^X//" >'postscript/demos/wow' <<'END_OF_FILE'
  608. X%!
  609. X.01 setlinewidth
  610. Xclippath pathbbox newpath
  611. X
  612. X3 -1 roll sub 2 div 3 1 roll exch sub 2 div exch
  613. X2 copy translate
  614. X2 copy gt {exch} if pop dup scale
  615. X90 rotate
  616. X25 { 0 .9 moveto 0 0 1 90 -90 arc
  617. X    0 0 .9 -90 90 arcn fill
  618. X    .88 .88 scale 22.5 rotate } repeat
  619. X
  620. Xshowpage
  621. END_OF_FILE
  622. if test 262 -ne `wc -c <'postscript/demos/wow'`; then
  623.     echo shar: \"'postscript/demos/wow'\" unpacked with wrong size!
  624. fi
  625. # end of 'postscript/demos/wow'
  626. fi
  627. if test -f 'postscript/demos/wow2' -a "${1}" != "-c" ; then 
  628.   echo shar: Will not clobber existing file \"'postscript/demos/wow2'\"
  629. else
  630. echo shar: Extracting \"'postscript/demos/wow2'\" \(320 characters\)
  631. sed "s/^X//" >'postscript/demos/wow2' <<'END_OF_FILE'
  632. X%!
  633. X.01 setlinewidth
  634. Xclippath pathbbox newpath
  635. X
  636. X3 -1 roll sub 2 div 3 1 roll exch sub 2 div exch
  637. X2 copy translate
  638. X2 copy gt {exch} if pop dup scale
  639. X90 rotate
  640. X/shade 0 def
  641. X25 {
  642. X    shade setgray /shade 1 25 div shade add def
  643. X    0 .9 moveto 0 0 1 90 -90 arc
  644. X    0 0 .9 -90 90 arcn fill
  645. X    .88 .88 scale 22.5 rotate } repeat
  646. Xshowpage
  647. END_OF_FILE
  648. if test 320 -ne `wc -c <'postscript/demos/wow2'`; then
  649.     echo shar: \"'postscript/demos/wow2'\" unpacked with wrong size!
  650. fi
  651. # end of 'postscript/demos/wow2'
  652. fi
  653. if test -f 'postscript/demos/wow3' -a "${1}" != "-c" ; then 
  654.   echo shar: Will not clobber existing file \"'postscript/demos/wow3'\"
  655. else
  656. echo shar: Extracting \"'postscript/demos/wow3'\" \(348 characters\)
  657. sed "s/^X//" >'postscript/demos/wow3' <<'END_OF_FILE'
  658. X%!
  659. X.01 setlinewidth
  660. Xclippath pathbbox newpath
  661. X
  662. X/big 1.0 31 { 2 mul } repeat def
  663. X
  664. X3 -1 roll sub 2 div 3 1 roll exch sub 2 div exch
  665. X2 copy translate
  666. X2 copy gt {exch} if pop dup scale
  667. X90 rotate
  668. X25 {
  669. X    rand big div rand big div rand big div setrgbcolor
  670. X    0 .9 moveto 0 0 1 90 -90 arc
  671. X    0 0 .9 -90 90 arcn fill
  672. X    .88 .88 scale 22.5 rotate } repeat
  673. Xshowpage
  674. END_OF_FILE
  675. if test 348 -ne `wc -c <'postscript/demos/wow3'`; then
  676.     echo shar: \"'postscript/demos/wow3'\" unpacked with wrong size!
  677. fi
  678. # end of 'postscript/demos/wow3'
  679. fi
  680. if test ! -d 'postscript/font' ; then
  681.     echo shar: Creating directory \"'postscript/font'\"
  682.     mkdir 'postscript/font'
  683. fi
  684. if test -f 'postscript/font-map' -a "${1}" != "-c" ; then 
  685.   echo shar: Will not clobber existing file \"'postscript/font-map'\"
  686. else
  687. echo shar: Extracting \"'postscript/font-map'\" \(277 characters\)
  688. sed "s/^X//" >'postscript/font-map' <<'END_OF_FILE'
  689. XFontMap /Times-BoldItalic /Times-BI put
  690. XFontMap /Helvetica-Oblique /Helvetica-Ob put
  691. XFontMap /Helvetica-Bold /Times-Roman put
  692. XFontMap /Symbol /Times-Roman put
  693. XFontMap /Courier /Helvetica put
  694. XFontMap /Courier-Oblique /Helvetica-Oblique put
  695. XFontMap /Courier-Bold /Times-Bold put
  696. END_OF_FILE
  697. if test 277 -ne `wc -c <'postscript/font-map'`; then
  698.     echo shar: \"'postscript/font-map'\" unpacked with wrong size!
  699. fi
  700. # end of 'postscript/font-map'
  701. fi
  702. if test -f 'postscript/font/Helvetica' -a "${1}" != "-c" ; then 
  703.   echo shar: Will not clobber existing file \"'postscript/font/Helvetica'\"
  704. else
  705. echo shar: Extracting \"'postscript/font/Helvetica'\" \(60 characters\)
  706. sed "s/^X//" >'postscript/font/Helvetica' <<'END_OF_FILE'
  707. X/Helvetica (fonts/SANS/roman.r) lib (font/proforma) lib run
  708. END_OF_FILE
  709. if test 60 -ne `wc -c <'postscript/font/Helvetica'`; then
  710.     echo shar: \"'postscript/font/Helvetica'\" unpacked with wrong size!
  711. fi
  712. # end of 'postscript/font/Helvetica'
  713. fi
  714. if test -f 'postscript/font/Helvetica-Ob' -a "${1}" != "-c" ; then 
  715.   echo shar: Will not clobber existing file \"'postscript/font/Helvetica-Ob'\"
  716. else
  717. echo shar: Extracting \"'postscript/font/Helvetica-Ob'\" \(64 characters\)
  718. sed "s/^X//" >'postscript/font/Helvetica-Ob' <<'END_OF_FILE'
  719. X/Helvetica-Ob (fonts/SANS/italic.r) lib (font/proforma) lib run
  720. END_OF_FILE
  721. if test 64 -ne `wc -c <'postscript/font/Helvetica-Ob'`; then
  722.     echo shar: \"'postscript/font/Helvetica-Ob'\" unpacked with wrong size!
  723. fi
  724. # end of 'postscript/font/Helvetica-Ob'
  725. fi
  726. if test -f 'postscript/font/Times-BI' -a "${1}" != "-c" ; then 
  727.   echo shar: Will not clobber existing file \"'postscript/font/Times-BI'\"
  728. else
  729. echo shar: Extracting \"'postscript/font/Times-BI'\" \(61 characters\)
  730. sed "s/^X//" >'postscript/font/Times-BI' <<'END_OF_FILE'
  731. X/Times-BI (fonts/TIMES/italic.r) lib (font/proforma) lib run
  732. END_OF_FILE
  733. if test 61 -ne `wc -c <'postscript/font/Times-BI'`; then
  734.     echo shar: \"'postscript/font/Times-BI'\" unpacked with wrong size!
  735. fi
  736. # end of 'postscript/font/Times-BI'
  737. fi
  738. if test -f 'postscript/font/Times-Bold' -a "${1}" != "-c" ; then 
  739.   echo shar: Will not clobber existing file \"'postscript/font/Times-Bold'\"
  740. else
  741. echo shar: Extracting \"'postscript/font/Times-Bold'\" \(62 characters\)
  742. sed "s/^X//" >'postscript/font/Times-Bold' <<'END_OF_FILE'
  743. X/Times-Bold (fonts/TIMES/roman.r) lib (font/proforma) lib run
  744. END_OF_FILE
  745. if test 62 -ne `wc -c <'postscript/font/Times-Bold'`; then
  746.     echo shar: \"'postscript/font/Times-Bold'\" unpacked with wrong size!
  747. fi
  748. # end of 'postscript/font/Times-Bold'
  749. fi
  750. if test -f 'postscript/font/Times-Italic' -a "${1}" != "-c" ; then 
  751.   echo shar: Will not clobber existing file \"'postscript/font/Times-Italic'\"
  752. else
  753. echo shar: Extracting \"'postscript/font/Times-Italic'\" \(63 characters\)
  754. sed "s/^X//" >'postscript/font/Times-Italic' <<'END_OF_FILE'
  755. X/Times-Italic (fonts/Times/italic) lib (font/proforma) lib run
  756. END_OF_FILE
  757. if test 63 -ne `wc -c <'postscript/font/Times-Italic'`; then
  758.     echo shar: \"'postscript/font/Times-Italic'\" unpacked with wrong size!
  759. fi
  760. # end of 'postscript/font/Times-Italic'
  761. fi
  762. if test -f 'postscript/font/Times-Roman' -a "${1}" != "-c" ; then 
  763.   echo shar: Will not clobber existing file \"'postscript/font/Times-Roman'\"
  764. else
  765. echo shar: Extracting \"'postscript/font/Times-Roman'\" \(61 characters\)
  766. sed "s/^X//" >'postscript/font/Times-Roman' <<'END_OF_FILE'
  767. X/Times-Roman (fonts/Times/roman) lib (font/proforma) lib run
  768. END_OF_FILE
  769. if test 61 -ne `wc -c <'postscript/font/Times-Roman'`; then
  770.     echo shar: \"'postscript/font/Times-Roman'\" unpacked with wrong size!
  771. fi
  772. # end of 'postscript/font/Times-Roman'
  773. fi
  774. if test -f 'postscript/font/Times-Roman-Adobe' -a "${1}" != "-c" ; then 
  775.   echo shar: Will not clobber existing file \"'postscript/font/Times-Roman-Adobe'\"
  776. else
  777. echo shar: Extracting \"'postscript/font/Times-Roman-Adobe'\" \(74 characters\)
  778. sed "s/^X//" >'postscript/font/Times-Roman-Adobe' <<'END_OF_FILE'
  779. X/Times-Roman-Adobe (widths/Adobe/Times-Roman) lib (font/proforma) lib run
  780. END_OF_FILE
  781. if test 74 -ne `wc -c <'postscript/font/Times-Roman-Adobe'`; then
  782.     echo shar: \"'postscript/font/Times-Roman-Adobe'\" unpacked with wrong size!
  783. fi
  784. # end of 'postscript/font/Times-Roman-Adobe'
  785. fi
  786. if test -f 'postscript/font/proforma' -a "${1}" != "-c" ; then 
  787.   echo shar: Will not clobber existing file \"'postscript/font/proforma'\"
  788. else
  789. echo shar: Extracting \"'postscript/font/proforma'\" \(531 characters\)
  790. sed "s/^X//" >'postscript/font/proforma' <<'END_OF_FILE'
  791. X% FontName CharFile 
  792. X
  793. X30 dict begin
  794. X    /CharFile exch def
  795. X    /FontName exch def
  796. X    /FontType 3 def
  797. X    /FontBBox [0.0 -32.0 32.0 32.0] def
  798. X    /FontMatrix [ 1 38.0 div 0 0 -1 32.0 div 0 0] def
  799. X    /Encoding 256 array def
  800. X    StandardEncoding Encoding copy pop
  801. X    /Metrics 256 dict def
  802. X    /CharStrings 256 dict def
  803. X    /BuildChar {
  804. X        1 index begin
  805. X            FontDirectory FontName get /BuildChar /buildhershey load put
  806. X            currentdict /BuildChar /buildhershey load put
  807. X            CharFile run
  808. X            /BuildChar load
  809. X        end
  810. X        exec
  811. X    } def
  812. X    FontName currentdict definefont pop
  813. Xend
  814. END_OF_FILE
  815. if test 531 -ne `wc -c <'postscript/font/proforma'`; then
  816.     echo shar: \"'postscript/font/proforma'\" unpacked with wrong size!
  817. fi
  818. # end of 'postscript/font/proforma'
  819. fi
  820. if test ! -d 'postscript/fonts' ; then
  821.     echo shar: Creating directory \"'postscript/fonts'\"
  822.     mkdir 'postscript/fonts'
  823. fi
  824. if test ! -d 'postscript/fonts/Gothic' ; then
  825.     echo shar: Creating directory \"'postscript/fonts/Gothic'\"
  826.     mkdir 'postscript/fonts/Gothic'
  827. fi
  828. if test ! -d 'postscript/fonts/Olde' ; then
  829.     echo shar: Creating directory \"'postscript/fonts/Olde'\"
  830.     mkdir 'postscript/fonts/Olde'
  831. fi
  832. if test ! -d 'postscript/fonts/SANS' ; then
  833.     echo shar: Creating directory \"'postscript/fonts/SANS'\"
  834.     mkdir 'postscript/fonts/SANS'
  835. fi
  836. if test ! -d 'postscript/fonts/Sans' ; then
  837.     echo shar: Creating directory \"'postscript/fonts/Sans'\"
  838.     mkdir 'postscript/fonts/Sans'
  839. fi
  840. if test ! -d 'postscript/fonts/TIMES' ; then
  841.     echo shar: Creating directory \"'postscript/fonts/TIMES'\"
  842.     mkdir 'postscript/fonts/TIMES'
  843. fi
  844. if test ! -d 'postscript/fonts/Times' ; then
  845.     echo shar: Creating directory \"'postscript/fonts/Times'\"
  846.     mkdir 'postscript/fonts/Times'
  847. fi
  848. if test -f 'postscript/fonts/Times/italic' -a "${1}" != "-c" ; then 
  849.   echo shar: Will not clobber existing file \"'postscript/fonts/Times/italic'\"
  850. else
  851. echo shar: Extracting \"'postscript/fonts/Times/italic'\" \(62 characters\)
  852. sed "s/^X//" >'postscript/fonts/Times/italic' <<'END_OF_FILE'
  853. X(fonts/Times/italic.r)
  854. Xlib
  855. Xrun
  856. X(fonts/Times/italic.a)
  857. Xlib
  858. Xrun
  859. END_OF_FILE
  860. if test 62 -ne `wc -c <'postscript/fonts/Times/italic'`; then
  861.     echo shar: \"'postscript/fonts/Times/italic'\" unpacked with wrong size!
  862. fi
  863. # end of 'postscript/fonts/Times/italic'
  864. fi
  865. if test -f 'postscript/fonts/Times/roman' -a "${1}" != "-c" ; then 
  866.   echo shar: Will not clobber existing file \"'postscript/fonts/Times/roman'\"
  867. else
  868. echo shar: Extracting \"'postscript/fonts/Times/roman'\" \(60 characters\)
  869. sed "s/^X//" >'postscript/fonts/Times/roman' <<'END_OF_FILE'
  870. X(fonts/Times/roman.r)
  871. Xlib
  872. Xrun
  873. X(fonts/Times/roman.a)
  874. Xlib
  875. Xrun
  876. END_OF_FILE
  877. if test 60 -ne `wc -c <'postscript/fonts/Times/roman'`; then
  878.     echo shar: \"'postscript/fonts/Times/roman'\" unpacked with wrong size!
  879. fi
  880. # end of 'postscript/fonts/Times/roman'
  881. fi
  882. if test ! -d 'postscript/fonts/extra' ; then
  883.     echo shar: Creating directory \"'postscript/fonts/extra'\"
  884.     mkdir 'postscript/fonts/extra'
  885. fi
  886. if test ! -d 'postscript/fonts/sans' ; then
  887.     echo shar: Creating directory \"'postscript/fonts/sans'\"
  888.     mkdir 'postscript/fonts/sans'
  889. fi
  890. if test -f 'postscript/fonts/sans/greek.r' -a "${1}" != "-c" ; then 
  891.   echo shar: Will not clobber existing file \"'postscript/fonts/sans/greek.r'\"
  892. else
  893. echo shar: Extracting \"'postscript/fonts/sans/greek.r'\" \(2045 characters\)
  894. sed "s/^X//" >'postscript/fonts/sans/greek.r' <<'END_OF_FILE'
  895. XCharStrings
  896. X/27
  897. X<C53B
  898. X4144
  899. XC53B
  900. X4944
  901. XC341
  902. X4741
  903. X>
  904. Xput
  905. XMetrics
  906. X/27
  907. X[0
  908. X10]
  909. Xput
  910. XCharStrings
  911. X/28
  912. X<C23B
  913. X4244
  914. XC23B
  915. X463B
  916. X483C
  917. X483E
  918. X463F
  919. XC23F
  920. X463F
  921. X4840
  922. X4843
  923. X4644
  924. X4244
  925. X>
  926. Xput
  927. XMetrics
  928. X/28
  929. X[0
  930. X10]
  931. Xput
  932. XCharStrings
  933. X/29
  934. X<C23B
  935. X4244
  936. XC23B
  937. X483B
  938. X>
  939. Xput
  940. XMetrics
  941. X/29
  942. X[0
  943. X9]
  944. Xput
  945. XCharStrings
  946. X/30
  947. X<C53B
  948. X4144
  949. XC53B
  950. X4944
  951. XC144
  952. X4944
  953. X>
  954. Xput
  955. XMetrics
  956. X/30
  957. X[0
  958. X10]
  959. Xput
  960. XCharStrings
  961. X/31
  962. X<C23B
  963. X4244
  964. XC23B
  965. X483B
  966. XC23F
  967. X463F
  968. XC244
  969. X4844
  970. X>
  971. Xput
  972. XMetrics
  973. X/31
  974. X[0
  975. X10]
  976. Xput
  977. XCharStrings
  978. X/32
  979. X<C83B
  980. X4244
  981. XC23B
  982. X483B
  983. XC244
  984. X4844
  985. X>
  986. Xput
  987. XMetrics
  988. X/32
  989. X[0
  990. X10]
  991. Xput
  992. XCharStrings
  993. X/33
  994. X<C23B
  995. X4244
  996. XC83B
  997. X4844
  998. XC23F
  999. X483F
  1000. X>
  1001. Xput
  1002. XMetrics
  1003. X/33
  1004. X[0
  1005. X10]
  1006. Xput
  1007. XCharStrings
  1008. X/34
  1009. X<C53B
  1010. X433C
  1011. X423E
  1012. X4241
  1013. X4343
  1014. X4544
  1015. X4644
  1016. X4843
  1017. X4941
  1018. X493E
  1019. X483C
  1020. X463B
  1021. X453B
  1022. XC43F
  1023. X4740
  1024. XC73F
  1025. X4440
  1026. X>
  1027. Xput
  1028. XMetrics
  1029. X/34
  1030. X[0
  1031. X11]
  1032. Xput
  1033. XCharStrings
  1034. X/35
  1035. X<C23B
  1036. X4244
  1037. X>
  1038. Xput
  1039. XMetrics
  1040. X/35
  1041. X[3
  1042. X4]
  1043. Xput
  1044. XCharStrings
  1045. X/36
  1046. X<C23B
  1047. X4244
  1048. XC83B
  1049. X4241
  1050. XC43F
  1051. X4844
  1052. X>
  1053. Xput
  1054. XMetrics
  1055. X/36
  1056. X[0
  1057. X10]
  1058. Xput
  1059. XCharStrings
  1060. X/37
  1061. X<C53B
  1062. X4144
  1063. XC53B
  1064. X4944
  1065. X>
  1066. Xput
  1067. XMetrics
  1068. X/37
  1069. X[0
  1070. X10]
  1071. Xput
  1072. XCharStrings
  1073. X/38
  1074. X<C23B
  1075. X4244
  1076. XC23B
  1077. X4644
  1078. XCA3B
  1079. X4644
  1080. XCA3B
  1081. X4A44
  1082. X>
  1083. Xput
  1084. XMetrics
  1085. X/38
  1086. X[-1
  1087. X12]
  1088. Xput
  1089. XCharStrings
  1090. X/39
  1091. X<C23B
  1092. X4244
  1093. XC23B
  1094. X4844
  1095. XC83B
  1096. X4844
  1097. X>
  1098. Xput
  1099. XMetrics
  1100. X/39
  1101. X[0
  1102. X10]
  1103. Xput
  1104. XCharStrings
  1105. X/40
  1106. X<C23B
  1107. X483B
  1108. XC33F
  1109. X4740
  1110. XC73F
  1111. X4340
  1112. XC244
  1113. X4844
  1114. X>
  1115. Xput
  1116. XMetrics
  1117. X/40
  1118. X[0
  1119. X10]
  1120. Xput
  1121. XCharStrings
  1122. X/41
  1123. X<C53B
  1124. X433C
  1125. X423E
  1126. X4241
  1127. X4343
  1128. X4544
  1129. X4644
  1130. X4843
  1131. X4941
  1132. X493E
  1133. X483C
  1134. X463B
  1135. X453B
  1136. X>
  1137. Xput
  1138. XMetrics
  1139. X/41
  1140. X[0
  1141. X11]
  1142. Xput
  1143. XCharStrings
  1144. X/42
  1145. X<C23B
  1146. X4244
  1147. XC83B
  1148. X4844
  1149. XC23B
  1150. X483B
  1151. X>
  1152. Xput
  1153. XMetrics
  1154. X/42
  1155. X[0
  1156. X10]
  1157. Xput
  1158. XCharStrings
  1159. X/43
  1160. X<C23B
  1161. X4244
  1162. XC23B
  1163. X463B
  1164. X483C
  1165. X483F
  1166. X4640
  1167. X4240
  1168. X>
  1169. Xput
  1170. XMetrics
  1171. X/43
  1172. X[0
  1173. X10]
  1174. Xput
  1175. XCharStrings
  1176. X/44
  1177. X<C23B
  1178. X453F
  1179. X4244
  1180. XC23B
  1181. X483B
  1182. XC244
  1183. X4844
  1184. X>
  1185. Xput
  1186. XMetrics
  1187. X/44
  1188. X[0
  1189. X10]
  1190. Xput
  1191. XCharStrings
  1192. X/45
  1193. X<C53B
  1194. X4544
  1195. XC13B
  1196. X493B
  1197. X>
  1198. Xput
  1199. XMetrics
  1200. X/45
  1201. X[0
  1202. X10]
  1203. Xput
  1204. XCharStrings
  1205. X/46
  1206. X<C13D
  1207. X413C
  1208. X423B
  1209. X433B
  1210. X443C
  1211. X453E
  1212. X4544
  1213. XC93D
  1214. X493C
  1215. X483B
  1216. X473B
  1217. X463C
  1218. X453E
  1219. X>
  1220. Xput
  1221. XMetrics
  1222. X/46
  1223. X[0
  1224. X10]
  1225. Xput
  1226. XCharStrings
  1227. X/47
  1228. X<C63B
  1229. X4644
  1230. XC43D
  1231. X423E
  1232. X4241
  1233. X4442
  1234. X4842
  1235. X4A41
  1236. X4A3E
  1237. X483D
  1238. X443D
  1239. X>
  1240. Xput
  1241. XMetrics
  1242. X/47
  1243. X[-1
  1244. X12]
  1245. Xput
  1246. XCharStrings
  1247. X/48
  1248. X<C23B
  1249. X4844
  1250. XC83B
  1251. X4244
  1252. X>
  1253. Xput
  1254. XMetrics
  1255. X/48
  1256. X[0
  1257. X10]
  1258. Xput
  1259. XCharStrings
  1260. X/49
  1261. X<C63B
  1262. X4644
  1263. XC23D
  1264. X433E
  1265. X4341
  1266. X4542
  1267. X4742
  1268. X4941
  1269. X493E
  1270. X4A3D
  1271. X>
  1272. Xput
  1273. XMetrics
  1274. X/49
  1275. X[-1
  1276. X12]
  1277. Xput
  1278. XCharStrings
  1279. X/50
  1280. X<C244
  1281. X4444
  1282. X4240
  1283. X423E
  1284. X433C
  1285. X453B
  1286. X463B
  1287. X483C
  1288. X493E
  1289. X4940
  1290. X4744
  1291. X4944
  1292. X>
  1293. Xput
  1294. XMetrics
  1295. X/50
  1296. X[0
  1297. X11]
  1298. Xput
  1299. END_OF_FILE
  1300. if test 2045 -ne `wc -c <'postscript/fonts/sans/greek.r'`; then
  1301.     echo shar: \"'postscript/fonts/sans/greek.r'\" unpacked with wrong size!
  1302. fi
  1303. # end of 'postscript/fonts/sans/greek.r'
  1304. fi
  1305. if test ! -d 'postscript/fonts/times' ; then
  1306.     echo shar: Creating directory \"'postscript/fonts/times'\"
  1307.     mkdir 'postscript/fonts/times'
  1308. fi
  1309. if test ! -d 'postscript/widths' ; then
  1310.     echo shar: Creating directory \"'postscript/widths'\"
  1311.     mkdir 'postscript/widths'
  1312. fi
  1313. if test ! -d 'postscript/widths/Adobe' ; then
  1314.     echo shar: Creating directory \"'postscript/widths/Adobe'\"
  1315.     mkdir 'postscript/widths/Adobe'
  1316. fi
  1317. if test ! -d 'source' ; then
  1318.     echo shar: Creating directory \"'source'\"
  1319.     mkdir 'source'
  1320. fi
  1321. if test -f 'source/README' -a "${1}" != "-c" ; then 
  1322.   echo shar: Will not clobber existing file \"'source/README'\"
  1323. else
  1324. echo shar: Extracting \"'source/README'\" \(839 characters\)
  1325. sed "s/^X//" >'source/README' <<'END_OF_FILE'
  1326. XThis is a virtually complete implementation of PostScript.  Just type
  1327. Xmake and it should produce a version for suns.  Since the only complete
  1328. Xdriver is for suns and since some driver writing will be necessary on
  1329. Xany other machine, I have not packaged everything up in an idiot-proof
  1330. Xbox.  I am not aware of any Gotchas in building this source.  The X
  1331. Xdriver used to work on X10 - It will need work for X11.  The pixrect
  1332. Xdriver is very new, and should be regarded as didactic, as it scribbles
  1333. Xstraight onto the display.  Persuading suntools to look after the bits
  1334. Xwould have taken too long.
  1335. X
  1336. XWriting your own driver involves merely hacking pixrect.c until it will
  1337. Xdrive your display.  There are only 11 routines to write, and they're
  1338. Xall quite short.
  1339. X
  1340. XHave fun!
  1341. X
  1342. X- Crispin Goswell
  1343. X
  1344. Xcaag@uk.ac.rl.vd
  1345. Xcaag@vd.rl.ac.uk
  1346. X...!mcvax!ukc!rlvd!caag
  1347. END_OF_FILE
  1348. if test 839 -ne `wc -c <'source/README'`; then
  1349.     echo shar: \"'source/README'\" unpacked with wrong size!
  1350. fi
  1351. # end of 'source/README'
  1352. fi
  1353. if test -f 'source/canon.c' -a "${1}" != "-c" ; then 
  1354.   echo shar: Will not clobber existing file \"'source/canon.c'\"
  1355. else
  1356. echo shar: Extracting \"'source/canon.c'\" \(1318 characters\)
  1357. sed "s/^X//" >'source/canon.c' <<'END_OF_FILE'
  1358. X/*
  1359. X * Copyright (C) Rutherford Appleton Laboratory 1987
  1360. X * 
  1361. X * This source may be copied, distributed, altered or used, but not sold for profit
  1362. X * or incorporated into a product except under licence from the author.
  1363. X * It is not in the public domain.
  1364. X * This notice should remain in the source unaltered, and any changes to the source
  1365. X * made by persons other than the author should be marked as such.
  1366. X * 
  1367. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  1368. X */
  1369. X#include "main.h"
  1370. X#include "graphics.h"
  1371. X#include "canon.h"
  1372. X
  1373. Xint pixels_per_inch;
  1374. X
  1375. Xint single_rop [] =
  1376. X {
  1377. X    ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE,
  1378. X    ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE,
  1379. X    ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE,
  1380. X    ROP_FALSE, ROP_DEST, ROP_NOTDEST, ROP_TRUE
  1381. X };
  1382. X
  1383. X/*ARGSUSED*/
  1384. XMatrix DeviceMatrix (width, height) int width, height;
  1385. X {
  1386. X     return NewMatrix (pixels_per_inch / 72.0, 0.0, 0.0, -pixels_per_inch / 72.0, 0.0, (float) height);
  1387. X }
  1388. X
  1389. Xvoid HardUpdate ()
  1390. X {
  1391. X }
  1392. X
  1393. Xint IsWindowHardware (h) struct hardware *h;
  1394. X {
  1395. X     return h->flags & ISWIN;
  1396. X }
  1397. X
  1398. X#define IsWindowHardware(h) ((h)->flags & ISWIN)
  1399. X
  1400. XDevicePoint HardwareExtent (h) struct hardware *h;
  1401. X {
  1402. X     if (h)
  1403. X         return h->extent;
  1404. X     else
  1405. X         return NewDevicePoint (0, 0);
  1406. X }
  1407. X
  1408. Xvoid SetClipHardware (h, clip) struct hardware *h, *clip;
  1409. X {
  1410. X     if (h)
  1411. X        h->clip = clip;
  1412. X }
  1413. END_OF_FILE
  1414. if test 1318 -ne `wc -c <'source/canon.c'`; then
  1415.     echo shar: \"'source/canon.c'\" unpacked with wrong size!
  1416. fi
  1417. # end of 'source/canon.c'
  1418. fi
  1419. if test -f 'source/canon.h' -a "${1}" != "-c" ; then 
  1420.   echo shar: Will not clobber existing file \"'source/canon.h'\"
  1421. else
  1422. echo shar: Extracting \"'source/canon.h'\" \(351 characters\)
  1423. sed "s/^X//" >'source/canon.h' <<'END_OF_FILE'
  1424. X/*
  1425. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1426. X */
  1427. X
  1428. X#define ISWIN    1
  1429. X
  1430. Xstruct hardware
  1431. X {
  1432. X     union hard {
  1433. X         char *addr;
  1434. X         int handle;
  1435. X     } hard;
  1436. X     int flags;
  1437. X     DevicePoint extent;
  1438. X     struct hardware *aux, *clip;
  1439. X };
  1440. X
  1441. Xextern void InitTransfer ();
  1442. Xextern int pixels_per_inch;
  1443. X
  1444. Xextern int single_rop[];
  1445. X
  1446. Xextern struct hardware *GraySync ();
  1447. END_OF_FILE
  1448. if test 351 -ne `wc -c <'source/canon.h'`; then
  1449.     echo shar: \"'source/canon.h'\" unpacked with wrong size!
  1450. fi
  1451. # end of 'source/canon.h'
  1452. fi
  1453. if test -f 'source/colour.h' -a "${1}" != "-c" ; then 
  1454.   echo shar: Will not clobber existing file \"'source/colour.h'\"
  1455. else
  1456. echo shar: Extracting \"'source/colour.h'\" \(311 characters\)
  1457. sed "s/^X//" >'source/colour.h' <<'END_OF_FILE'
  1458. X/*
  1459. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1460. X */
  1461. X
  1462. Xtypedef struct { float hue, saturation, brightness; } Colour;
  1463. X
  1464. Xextern Colour Black, White;
  1465. X
  1466. Xextern Colour NewColour (), NewHSBColour (), NewRGBColour (), NewGray ();
  1467. Xextern void ColourHSB (), ColourRGB ();
  1468. Xextern float Gray (), Brightness ();
  1469. END_OF_FILE
  1470. if test 311 -ne `wc -c <'source/colour.h'`; then
  1471.     echo shar: \"'source/colour.h'\" unpacked with wrong size!
  1472. fi
  1473. # end of 'source/colour.h'
  1474. fi
  1475. if test -f 'source/copyright.h' -a "${1}" != "-c" ; then 
  1476.   echo shar: Will not clobber existing file \"'source/copyright.h'\"
  1477. else
  1478. echo shar: Extracting \"'source/copyright.h'\" \(479 characters\)
  1479. sed "s/^X//" >'source/copyright.h' <<'END_OF_FILE'
  1480. X/*
  1481. X * Copyright (C) Rutherford Appleton Laboratory 1987
  1482. X * 
  1483. X * This source may be copied, distributed, altered or used, but not sold for profit
  1484. X * or incorporated into a product except under licence from the author.
  1485. X * It is not in the public domain.
  1486. X * This notice should remain in the source unaltered, and any changes to the source
  1487. X * made by persons other than the author should be marked as such.
  1488. X * 
  1489. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  1490. X */
  1491. END_OF_FILE
  1492. if test 479 -ne `wc -c <'source/copyright.h'`; then
  1493.     echo shar: \"'source/copyright.h'\" unpacked with wrong size!
  1494. fi
  1495. # end of 'source/copyright.h'
  1496. fi
  1497. if test -f 'source/device.h' -a "${1}" != "-c" ; then 
  1498.   echo shar: Will not clobber existing file \"'source/device.h'\"
  1499. else
  1500. echo shar: Extracting \"'source/device.h'\" \(345 characters\)
  1501. sed "s/^X//" >'source/device.h' <<'END_OF_FILE'
  1502. X/*
  1503. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1504. X */
  1505. X
  1506. X#include "hard.h"
  1507. X
  1508. Xstruct device
  1509. X {
  1510. X     Matrix default_matrix;
  1511. X     Path default_clip;
  1512. X     int link_count;
  1513. X     struct hardware *dev;
  1514. X };
  1515. X
  1516. Xextern struct device *NewDevice (), *NewCacheDevice (), *LinkDevice (), *DeviceFrom (), *UniqueDevice ();
  1517. Xextern struct device *NewBitmapDevice ();
  1518. END_OF_FILE
  1519. if test 345 -ne `wc -c <'source/device.h'`; then
  1520.     echo shar: \"'source/device.h'\" unpacked with wrong size!
  1521. fi
  1522. # end of 'source/device.h'
  1523. fi
  1524. if test -f 'source/font.h' -a "${1}" != "-c" ; then 
  1525.   echo shar: Will not clobber existing file \"'source/font.h'\"
  1526. else
  1527. echo shar: Extracting \"'source/font.h'\" \(190 characters\)
  1528. sed "s/^X//" >'source/font.h' <<'END_OF_FILE'
  1529. X/*
  1530. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1531. X */
  1532. X
  1533. X
  1534. Xextern Object Fid, FD, FontMatrix, FontType, Encoding, FontBBox, FontName;
  1535. Xextern Object UserShow, CharStrings, Metrics;
  1536. END_OF_FILE
  1537. if test 190 -ne `wc -c <'source/font.h'`; then
  1538.     echo shar: \"'source/font.h'\" unpacked with wrong size!
  1539. fi
  1540. # end of 'source/font.h'
  1541. fi
  1542. if test -f 'source/graphics.h' -a "${1}" != "-c" ; then 
  1543.   echo shar: Will not clobber existing file \"'source/graphics.h'\"
  1544. else
  1545. echo shar: Extracting \"'source/graphics.h'\" \(1047 characters\)
  1546. sed "s/^X//" >'source/graphics.h' <<'END_OF_FILE'
  1547. X/*
  1548. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1549. X */
  1550. X
  1551. X#include "device.h"
  1552. X#include "point.h"
  1553. X#include "font.h"
  1554. X
  1555. X#define PI 3.14159265358979
  1556. X
  1557. X#define MAXDASH    11
  1558. X
  1559. X#define MAXGSAVES    20
  1560. X
  1561. X#define BBOX_LEFT    0
  1562. X#define BBOX_TOP    1
  1563. X#define BBOX_RIGHT    2
  1564. X#define BBOX_BOTTOM    3
  1565. X
  1566. Xstruct show_context
  1567. X {
  1568. X     char InShow;
  1569. X     char space;
  1570. X    Point Width;
  1571. X    HardPoint shim, space_shim;
  1572. X     Object CharName;
  1573. X     struct cache *ccache;
  1574. X     Matrix mat;
  1575. X };
  1576. X
  1577. Xstruct state
  1578. X {
  1579. X     Matrix CTM;
  1580. X     Colour colour;
  1581. X     HardPoint cp; int cp_defined;
  1582. X     Path path;
  1583. X     Path clip;
  1584. X     Object font;
  1585. X     float line_width;
  1586. X     int line_cap;
  1587. X     int line_join;
  1588. X     struct
  1589. X      {
  1590. X          float frequency, rotation, *thresh;
  1591. X          int count;
  1592. X          Object spot_function;
  1593. X       } screen;
  1594. X     struct {
  1595. X         Object transfn;
  1596. X         float *tran;
  1597. X         int tcount;
  1598. X     } transfer;
  1599. X     int flatness;
  1600. X     float miter_limit;
  1601. X     float dash_offset, dash_array [MAXDASH];
  1602. X     int dash_length;
  1603. X    struct device *device;
  1604. X    struct show_context *show;
  1605. X    struct device *clipdevice;
  1606. X };
  1607. X
  1608. Xextern struct state *gstate;
  1609. X
  1610. Xextern int stroke_method, fill_method;
  1611. END_OF_FILE
  1612. if test 1047 -ne `wc -c <'source/graphics.h'`; then
  1613.     echo shar: \"'source/graphics.h'\" unpacked with wrong size!
  1614. fi
  1615. # end of 'source/graphics.h'
  1616. fi
  1617. if test -f 'source/hard.h' -a "${1}" != "-c" ; then 
  1618.   echo shar: Will not clobber existing file \"'source/hard.h'\"
  1619. else
  1620. echo shar: Extracting \"'source/hard.h'\" \(821 characters\)
  1621. sed "s/^X//" >'source/hard.h' <<'END_OF_FILE'
  1622. X/*
  1623. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1624. X */
  1625. X
  1626. X#include "mat.h"
  1627. X#include "rop.h"
  1628. X#include "colour.h"
  1629. X#include "path.h"
  1630. X
  1631. Xtypedef struct device_point { int dx, dy; } DevicePoint;
  1632. X
  1633. Xextern struct hardware *HardwareFromString (), *NewBitmapHardware (), *NewWindowHardware (), *InitHardware ();
  1634. Xextern DevicePoint HardwareExtent ();
  1635. Xextern char *StringFromHardware ();
  1636. X
  1637. Xextern void BitBlt (), BitBltBlob (), BitBltLine (), DestroyHardware ();
  1638. Xextern void HardUpdate (), UpdateControl ();
  1639. Xextern Matrix DeviceMatrix ();
  1640. X
  1641. Xextern void RasterTile (), BitBltTrapezoid ();
  1642. X
  1643. Xextern int IsWindowHardware (), TransferSize ();
  1644. Xextern void SetTransfer ();
  1645. Xextern void Paint (), PaintLine (), PaintTrapezoid ();
  1646. Xextern int ScreenSize ();
  1647. Xextern void BuildScreen (), SetScreen ();
  1648. Xextern DevicePoint NewDevicePoint ();
  1649. END_OF_FILE
  1650. if test 821 -ne `wc -c <'source/hard.h'`; then
  1651.     echo shar: \"'source/hard.h'\" unpacked with wrong size!
  1652. fi
  1653. # end of 'source/hard.h'
  1654. fi
  1655. if test -f 'source/head' -a "${1}" != "-c" ; then 
  1656.   echo shar: Will not clobber existing file \"'source/head'\"
  1657. else
  1658. echo shar: Extracting \"'source/head'\" \(68 characters\)
  1659. sed "s/^X//" >'source/head' <<'END_OF_FILE'
  1660. X/*
  1661. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1662. X */
  1663. X
  1664. END_OF_FILE
  1665. if test 68 -ne `wc -c <'source/head'`; then
  1666.     echo shar: \"'source/head'\" unpacked with wrong size!
  1667. fi
  1668. # end of 'source/head'
  1669. fi
  1670. if test -f 'source/head.ed' -a "${1}" != "-c" ; then 
  1671.   echo shar: Will not clobber existing file \"'source/head.ed'\"
  1672. else
  1673. echo shar: Extracting \"'source/head.ed'\" \(77 characters\)
  1674. sed "s/^X//" >'source/head.ed' <<'END_OF_FILE'
  1675. X1i
  1676. X/*
  1677. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1678. X */
  1679. X
  1680. X.
  1681. Xw
  1682. Xq
  1683. END_OF_FILE
  1684. if test 77 -ne `wc -c <'source/head.ed'`; then
  1685.     echo shar: \"'source/head.ed'\" unpacked with wrong size!
  1686. fi
  1687. # end of 'source/head.ed'
  1688. fi
  1689. if test -f 'source/makefile' -a "${1}" != "-c" ; then 
  1690.   echo shar: Will not clobber existing file \"'source/makefile'\"
  1691. else
  1692. echo shar: Extracting \"'source/makefile'\" \(1696 characters\)
  1693. sed "s/^X//" >'source/makefile' <<'END_OF_FILE'
  1694. XOBJECTS=array.o boolean.o config.o control.o dictionary.o file.o\
  1695. X    integer.o main.o math.o misc.o name.o operator.o\
  1696. X    poly.o property.o real.o save.o stack.o string.o unix.o
  1697. XLIBS=libww.a -lsuntool -lsunwindow -lpixrect -g
  1698. XGRAPHICS=cache.o colour.o device.o fill.o font.o gsave.o image.o mat.o matrix.o\
  1699. X    pat.o path.o state.o stroke.o
  1700. XCFLAGS=-O
  1701. X
  1702. XPS:    $(OBJECTS) $(GRAPHICS) hard.o canon.a
  1703. X    cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm `libs` -o PS
  1704. X
  1705. XsunPS:    $(OBJECTS) $(GRAPHICS) hard.o canon.a pixrect
  1706. X    cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) hard.o canon.a -lm -lpixrect -o sunPS
  1707. X
  1708. XCPS:    $(OBJECTS) $(GRAPHICS) colour-ww.o trapezoid.o canon.o
  1709. X    cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) colour-ww.o canon.o trapezoid.o -lm `libs` -o CPS
  1710. X
  1711. Xpostscript:    $(OBJECTS) $(GRAPHICS) adapter.o protocol.o
  1712. X    cc $(CFLAGS) $(OBJECTS) $(GRAPHICS) adapter.o protocol.o -lm -o postscript
  1713. X
  1714. XXPS:    $(OBJECTS) $(GRAPHICS) X.o
  1715. X    cc $(CFLAGS)  $(OBJECTS) $(GRAPHICS) X.o -lm -lX -o XPS
  1716. X
  1717. Xcanon.a:    canon.o screen.o trapezoid.o paint.o
  1718. X    ar ruv canon.a canon.o screen.o trapezoid.o paint.o
  1719. X    ranlib canon.a
  1720. X
  1721. Xviewer:    protocol.o viewer.o hard.o canon.a
  1722. X    cc protocol.o viewer.o hard.o canon.a `libs` -o viewer
  1723. X
  1724. Xall:    PS postscript viewer
  1725. X
  1726. Xww:    ww.o wwlib installww
  1727. X
  1728. Xpixrect:    pixrect.o
  1729. X    cp pixrect.o hard.o
  1730. X
  1731. Xsun:    ww wwsun
  1732. X
  1733. Xorion:    orion.o installorion orionlib
  1734. X
  1735. XX.o:    
  1736. X    cc -c X.c
  1737. X
  1738. Xwwlib:
  1739. X    if [ -f libww.a ]; \
  1740. X    then \
  1741. X        echo 'echo libww.a' >lww; \
  1742. X    else \
  1743. X        echo 'echo -lww' >lww; \
  1744. X    fi; \
  1745. X    chmod +x lww
  1746. X    echo "echo `lww`" >libs; chmod +x libs
  1747. X
  1748. Xwwsun:    
  1749. X    echo "echo `lww` -lsuntool -lsunwindow -lpixrect" >libs; chmod +x libs
  1750. X
  1751. Xorionlib:
  1752. X    echo 'echo -lG' >libs; chmod +x libs
  1753. X
  1754. Xinstallww:
  1755. X    cp ww.o hard.o
  1756. X
  1757. Xinstallorion:
  1758. X    cp orion.o hard.o
  1759. END_OF_FILE
  1760. if test 1696 -ne `wc -c <'source/makefile'`; then
  1761.     echo shar: \"'source/makefile'\" unpacked with wrong size!
  1762. fi
  1763. # end of 'source/makefile'
  1764. fi
  1765. if test -f 'source/malloc.c' -a "${1}" != "-c" ; then 
  1766.   echo shar: Will not clobber existing file \"'source/malloc.c'\"
  1767. else
  1768. echo shar: Extracting \"'source/malloc.c'\" \(1317 characters\)
  1769. sed "s/^X//" >'source/malloc.c' <<'END_OF_FILE'
  1770. X/*
  1771. X * Copyright (C) Rutherford Appleton Laboratory 1987
  1772. X * 
  1773. X * This source may be copied, distributed, altered or used, but not sold for profit
  1774. X * or incorporated into a product except under licence from the author.
  1775. X * It is not in the public domain.
  1776. X * This notice should remain in the source unaltered, and any changes to the source
  1777. X * made by persons other than the author should be marked as such.
  1778. X * 
  1779. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  1780. X */
  1781. X#define THRESHOLD 4096
  1782. X#define NULL 0
  1783. X
  1784. Xstatic char *FreeSpace = NULL, *sbrk ();
  1785. Xstatic int Left = 0;
  1786. X
  1787. Xchar *malloc (size) unsigned size;
  1788. X {
  1789. X     char *res;
  1790. X     
  1791. X     if (FreeSpace == NULL)
  1792. X         FreeSpace = sbrk (0);
  1793. X     
  1794. X     size = (size + 3) & ~3;
  1795. X     res = FreeSpace;
  1796. X     if (size > Left)
  1797. X      {
  1798. X          int chunk;
  1799. X
  1800. X          if (sbrk (chunk = size > THRESHOLD ? size : THRESHOLD) == (char *) -1)
  1801. X              return NULL;
  1802. X          Left += chunk;
  1803. X      }
  1804. X     Left -= size;         
  1805. X     FreeSpace += size;
  1806. X     
  1807. X     return res;
  1808. X }
  1809. X
  1810. Xint free (block) char *block;
  1811. X {
  1812. X }
  1813. X
  1814. Xchar *realloc (b, size) char *b; unsigned size;
  1815. X {
  1816. X     char *block = malloc (size);
  1817. X     
  1818. X     while (--size > 0)
  1819. X         *block++ = *b++;
  1820. X     return block;
  1821. X }
  1822. X
  1823. Xchar *calloc (size1, size2) unsigned size1, size2;
  1824. X {
  1825. X     unsigned total = size1 * size2;
  1826. X     char *res = malloc (total), *p = res;
  1827. X     
  1828. X     while (--total > 0)
  1829. X         *p++ = 0;
  1830. X     return res;
  1831. X }
  1832. END_OF_FILE
  1833. if test 1317 -ne `wc -c <'source/malloc.c'`; then
  1834.     echo shar: \"'source/malloc.c'\" unpacked with wrong size!
  1835. fi
  1836. # end of 'source/malloc.c'
  1837. fi
  1838. if test -f 'source/mat.h' -a "${1}" != "-c" ; then 
  1839.   echo shar: Will not clobber existing file \"'source/mat.h'\"
  1840. else
  1841. echo shar: Extracting \"'source/mat.h'\" \(388 characters\)
  1842. sed "s/^X//" >'source/mat.h' <<'END_OF_FILE'
  1843. X/*
  1844. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  1845. X */
  1846. X
  1847. Xtypedef struct matrix { float A, B, C, D, tx, ty; } Matrix;
  1848. X
  1849. Xtypedef struct vector { float vx, vy, vt; } Vector;
  1850. X
  1851. Xextern Matrix NewMatrix (), MatMult (), MatInvert (), Translate (), Rotate (), Scale ();
  1852. Xextern Vector NewVector (), DiffVector ();
  1853. Xextern Vector Transform (), ITransform (), DTransform (), IDTransform ();
  1854. END_OF_FILE
  1855. if test 388 -ne `wc -c <'source/mat.h'`; then
  1856.     echo shar: \"'source/mat.h'\" unpacked with wrong size!
  1857. fi
  1858. # end of 'source/mat.h'
  1859. fi
  1860. if test -f 'source/misc.c' -a "${1}" != "-c" ; then 
  1861.   echo shar: Will not clobber existing file \"'source/misc.c'\"
  1862. else
  1863. echo shar: Extracting \"'source/misc.c'\" \(886 characters\)
  1864. sed "s/^X//" >'source/misc.c' <<'END_OF_FILE'
  1865. X/*
  1866. X * Copyright (C) Rutherford Appleton Laboratory 1987
  1867. X * 
  1868. X * This source may be copied, distributed, altered or used, but not sold for profit
  1869. X * or incorporated into a product except under licence from the author.
  1870. X * It is not in the public domain.
  1871. X * This notice should remain in the source unaltered, and any changes to the source
  1872. X * made by persons other than the author should be marked as such.
  1873. X * 
  1874. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  1875. X */
  1876. X#include "main.h"
  1877. X#include <sys/param.h>
  1878. X#include <sys/times.h>
  1879. X#ifndef HZ
  1880. X#    define HZ 60
  1881. X#endif
  1882. X
  1883. Xstatic int PUserTime ();
  1884. X     
  1885. XInitMisc ()
  1886. X {
  1887. X      InstallOp ("usertime",    PUserTime,    0, 1, 0, 0);
  1888. X     InstallOp ("==",     PolyFirst,     1, 1, 0, 0, Poly);
  1889. X  }
  1890. X
  1891. Xstatic int PUserTime ()
  1892. X {
  1893. X     struct tms tbuf;
  1894. X     long times ();
  1895. X     
  1896. X    times (&tbuf);
  1897. X     return Push (OpStack, MakeInteger ((int) (tbuf.tms_utime * 1000 / HZ)));
  1898. X }
  1899. END_OF_FILE
  1900. if test 886 -ne `wc -c <'source/misc.c'`; then
  1901.     echo shar: \"'source/misc.c'\" unpacked with wrong size!
  1902. fi
  1903. # end of 'source/misc.c'
  1904. fi
  1905. if test -f 'source/null.c' -a "${1}" != "-c" ; then 
  1906.   echo shar: Will not clobber existing file \"'source/null.c'\"
  1907. else
  1908. echo shar: Extracting \"'source/null.c'\" \(2261 characters\)
  1909. sed "s/^X//" >'source/null.c' <<'END_OF_FILE'
  1910. X/*
  1911. X * Copyright (C) Rutherford Appleton Laboratory 1987
  1912. X * 
  1913. X * This source may be copied, distributed, altered or used, but not sold for profit
  1914. X * or incorporated into a product except under licence from the author.
  1915. X * It is not in the public domain.
  1916. X * This notice should remain in the source unaltered, and any changes to the source
  1917. X * made by persons other than the author should be marked as such.
  1918. X * 
  1919. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  1920. X */
  1921. X#include "main.h"
  1922. X#include "graphics.h"
  1923. X#include "canon.h"
  1924. X
  1925. Xstruct hardware *InitHardware ()
  1926. X {
  1927. X    InitTransfer (1);
  1928. X    
  1929. X    return NULL;
  1930. X }
  1931. X
  1932. Xstatic struct hardware *NewHardware (bits, width, height, flags) char *bits; int width, height, flags;
  1933. X {
  1934. X     struct hardware *d = (struct hardware *) Malloc (sizeof (struct hardware));
  1935. X     
  1936. X     d->hard.addr = bits;
  1937. X     d->flags = flags;
  1938. X     d->aux = d->clip = NULL;
  1939. X     d->extent = NewDevicePoint (width, height);
  1940. X     
  1941. X     return d;
  1942. X }
  1943. X
  1944. Xstruct hardware *NewWindowHardware (width, height) int width, height;
  1945. X {
  1946. X     return NewHardware (NULL, width, height, ISWIN);
  1947. X }
  1948. X
  1949. Xstruct hardware *NewBitmapHardware (width, height) int width, height;
  1950. X {
  1951. X     return NewHardware (NULL, width, height, 0);
  1952. X }
  1953. X
  1954. Xstatic void DestroyBits (b) char *b;
  1955. X {
  1956. X }
  1957. X
  1958. Xvoid DestroyHardware (dev) struct hardware *dev;
  1959. X {
  1960. X     if (dev == NULL)
  1961. X         return;
  1962. X     DestroyBits (dev->hard.addr);
  1963. X     if (dev->aux)
  1964. X         DestroyHardware (dev->aux);
  1965. X     Free ((char *) dev);
  1966. X }
  1967. X
  1968. Xstruct hardware *HardwareFromString (st, width, height) char *st; int width, height;
  1969. X {
  1970. X     Free (st);
  1971. X     return NewHardware (NULL, width, height, 0);
  1972. X }
  1973. X
  1974. Xchar *StringFromHardware (dev) struct hardware *dev;
  1975. X {
  1976. X     return Malloc ((dev->extent.dx + 7) / 8 *dev->extent.dy);
  1977. X }
  1978. X
  1979. Xvoid UpdateControl (h, flag) struct hardware *h; int flag;
  1980. X {
  1981. X }
  1982. X
  1983. Xvoid RasterTile (from, to, toPoint, extent, rop)
  1984. X    struct hardware *from, *to;
  1985. X    DevicePoint toPoint, extent;
  1986. X    int rop;
  1987. X {
  1988. X }
  1989. X
  1990. Xvoid BitBlt (from, to, fromPoint, toPoint, extent, rop)
  1991. X    struct hardware *from, *to;
  1992. X    DevicePoint fromPoint, toPoint, extent;
  1993. X    int rop;
  1994. X {
  1995. X }
  1996. X
  1997. Xvoid BitBltLine (h, fromPoint, toPoint, rop) 
  1998. X      struct hardware *h;
  1999. X    DevicePoint fromPoint, toPoint;
  2000. X    int rop;
  2001. X {
  2002. X }
  2003. X
  2004. Xvoid BitBltBlob (to, top, height, left, right, rop) struct hardware *to; int top, height, *left, *right, rop;
  2005. X {
  2006. X }
  2007. END_OF_FILE
  2008. if test 2261 -ne `wc -c <'source/null.c'`; then
  2009.     echo shar: \"'source/null.c'\" unpacked with wrong size!
  2010. fi
  2011. # end of 'source/null.c'
  2012. fi
  2013. if test -f 'source/path.h' -a "${1}" != "-c" ; then 
  2014.   echo shar: Will not clobber existing file \"'source/path.h'\"
  2015. else
  2016. echo shar: Extracting \"'source/path.h'\" \(1008 characters\)
  2017. sed "s/^X//" >'source/path.h' <<'END_OF_FILE'
  2018. X/*
  2019. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  2020. X */
  2021. X
  2022. X#define CBUTT    0
  2023. X#define CROUND    1
  2024. X#define CSQUARE    2
  2025. X
  2026. X#define JMITRE    0
  2027. X#define JROUND    1
  2028. X#define JBEVEL    2
  2029. X
  2030. X#define STROKE_FILL 0
  2031. X#define STROKE_THIN 1
  2032. X
  2033. X#define FILL_SINGLE        0
  2034. X#define FILL_CACHE_DOUBLE    1
  2035. X#define FILL_DOUBLE        2
  2036. X#define FILL_DOUBLE_STROKE    3
  2037. X
  2038. Xtypedef struct hard_point { float hx, hy; } HardPoint;
  2039. X
  2040. Xenum pelem_type { EHeader, EMove, ELine, EArc, ECurve, EClose };
  2041. X
  2042. Xstruct path_element
  2043. X {
  2044. X     enum pelem_type ptype;
  2045. X     union {
  2046. X          HardPoint point;
  2047. X        struct arc { int dir; HardPoint centre; float radius, from, to; } arc;
  2048. X         struct bezier { HardPoint x0, x1, x2; } curve;
  2049. X     } pe;
  2050. X     struct path_element *next, *last;
  2051. X };
  2052. X
  2053. Xtypedef struct path_element *Path;
  2054. X
  2055. Xextern HardPoint NewHardPoint (), ExtToInt (), MoveHardPoint ();
  2056. Xextern Path NewPath (), PathCopy (), NewMove ();
  2057. Xextern int PNewPath (), PInitMatrix ();
  2058. Xextern Path NewClipPath (), PathRemove (), ReversePath (), FlattenPath ();
  2059. Xextern float Normalise (), PointX (), PointY ();
  2060. END_OF_FILE
  2061. if test 1008 -ne `wc -c <'source/path.h'`; then
  2062.     echo shar: \"'source/path.h'\" unpacked with wrong size!
  2063. fi
  2064. # end of 'source/path.h'
  2065. fi
  2066. if test -f 'source/point.h' -a "${1}" != "-c" ; then 
  2067.   echo shar: Will not clobber existing file \"'source/point.h'\"
  2068. else
  2069. echo shar: Extracting \"'source/point.h'\" \(263 characters\)
  2070. sed "s/^X//" >'source/point.h' <<'END_OF_FILE'
  2071. X/*
  2072. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  2073. X */
  2074. X
  2075. Xtypedef struct point { float x, y; } Point;
  2076. X
  2077. Xextern Matrix PointTranslate ();
  2078. Xextern Point NewPoint (), IntToExt (), MovePoint ();
  2079. Xextern int MoveTo (), LineTo ();
  2080. Xextern Object AssignMatrix ();
  2081. END_OF_FILE
  2082. if test 263 -ne `wc -c <'source/point.h'`; then
  2083.     echo shar: \"'source/point.h'\" unpacked with wrong size!
  2084. fi
  2085. # end of 'source/point.h'
  2086. fi
  2087. if test -f 'source/protocol.h' -a "${1}" != "-c" ; then 
  2088.   echo shar: Will not clobber existing file \"'source/protocol.h'\"
  2089. else
  2090. echo shar: Extracting \"'source/protocol.h'\" \(954 characters\)
  2091. sed "s/^X//" >'source/protocol.h' <<'END_OF_FILE'
  2092. X/*
  2093. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  2094. X */
  2095. X
  2096. X#define NEW_WINDOW    'W'
  2097. X#define NEW_BITMAP    'B'
  2098. X#define BITBLT        'b'
  2099. X#define    SEND_BITMAP    's'
  2100. X#define GET_BITMAP    'g'
  2101. X#define    DESTROY_HARDWARE    'D'
  2102. X#define LINE        'l'
  2103. X#define GET_MATRIX    'm'
  2104. X#define GET_TRANSFERSIZE    't'
  2105. X#define SET_TRANSFER    'T'
  2106. X#define PAINT        'P'
  2107. X#define PAINT_LINE    'L'
  2108. X#define HARD_FLUSH    'F'
  2109. X#define SCREEN_SIZE    'Z'
  2110. X#define BUILD_SCREEN    'U'
  2111. X#define SET_SCREEN    'S'
  2112. X#define SET_CLIP_HARDWARE    'c'
  2113. X#define BITBLT_TRAPEZOID    'r'
  2114. X#define PAINT_TRAPEZOID    'R'
  2115. X#define SET_UPDATE_CONTROL    'u'
  2116. X
  2117. Xvoid master_protocol ();
  2118. Xvoid slave_protocol ();
  2119. Xvoid send_colour ();
  2120. XColour recv_colour ();
  2121. Xvoid send_small ();
  2122. Xfloat recv_small ();
  2123. Xvoid send_point ();
  2124. XDevicePoint recv_point ();
  2125. Xvoid send_byte ();
  2126. Xunsigned char recv_byte ();
  2127. Xvoid send_short ();
  2128. Xshort recv_short ();
  2129. Xvoid send_float ();
  2130. Xfloat recv_float ();
  2131. Xvoid send_string ();
  2132. Xvoid recv_string ();
  2133. Xvoid flush_protocol ();
  2134. Xint can_recv ();
  2135. END_OF_FILE
  2136. if test 954 -ne `wc -c <'source/protocol.h'`; then
  2137.     echo shar: \"'source/protocol.h'\" unpacked with wrong size!
  2138. fi
  2139. # end of 'source/protocol.h'
  2140. fi
  2141. if test -f 'source/rop.h' -a "${1}" != "-c" ; then 
  2142.   echo shar: Will not clobber existing file \"'source/rop.h'\"
  2143. else
  2144. echo shar: Extracting \"'source/rop.h'\" \(583 characters\)
  2145. sed "s/^X//" >'source/rop.h' <<'END_OF_FILE'
  2146. X/*
  2147. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  2148. X */
  2149. X
  2150. X#define ROP_FALSE    0    /* F        */
  2151. X#define ROP_AND        1    /* S & D    */
  2152. X#define ROP_ANDNOT    2    /* S & ~D    */
  2153. X#define ROP_SOURCE    3    /* S        */
  2154. X#define ROP_NOTAND    4    /* ~S & D    */
  2155. X#define ROP_DEST    5    /* D        */
  2156. X#define ROP_XOR        6    /* S ^ D    */
  2157. X#define ROP_OR        7    /* S | D    */
  2158. X#define ROP_NOR        8    /* ~(S | D)    */
  2159. X#define ROP_NXOR    9    /* ~(S ^ D)    */
  2160. X#define ROP_NOTDEST    10    /* ~D        */
  2161. X#define ROP_ORNOT    11    /* S | ~D    */
  2162. X#define ROP_NOTSOURCE    12    /* ~S        */
  2163. X#define ROP_NOTOR    13    /* ~S | D    */
  2164. X#define ROP_NAND    14    /* ~(S & D)    */
  2165. X#define ROP_TRUE    15    /* T        */
  2166. END_OF_FILE
  2167. if test 583 -ne `wc -c <'source/rop.h'`; then
  2168.     echo shar: \"'source/rop.h'\" unpacked with wrong size!
  2169. fi
  2170. # end of 'source/rop.h'
  2171. fi
  2172. if test -f 'source/save.c' -a "${1}" != "-c" ; then 
  2173.   echo shar: Will not clobber existing file \"'source/save.c'\"
  2174. else
  2175. echo shar: Extracting \"'source/save.c'\" \(966 characters\)
  2176. sed "s/^X//" >'source/save.c' <<'END_OF_FILE'
  2177. X/*
  2178. X * Copyright (C) Rutherford Appleton Laboratory 1987
  2179. X * 
  2180. X * This source may be copied, distributed, altered or used, but not sold for profit
  2181. X * or incorporated into a product except under licence from the author.
  2182. X * It is not in the public domain.
  2183. X * This notice should remain in the source unaltered, and any changes to the source
  2184. X * made by persons other than the author should be marked as such.
  2185. X * 
  2186. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  2187. X */
  2188. X#include "main.h"
  2189. X
  2190. X#define SMALL_SIZE    4096
  2191. X
  2192. Xstatic char *small_buf;
  2193. Xstatic int left = 0;
  2194. X
  2195. Xchar *Malloc (u) unsigned u;
  2196. X {
  2197. X     char *malloc (), *res;
  2198. X     
  2199. X    if (0/*u < SMALL_SIZE*/)
  2200. X      {
  2201. X           char *res;
  2202. X         if (left < u)
  2203. X          {
  2204. X             small_buf = Malloc (SMALL_SIZE);
  2205. X             left = SMALL_SIZE;
  2206. X          }
  2207. X          res = small_buf;
  2208. X          small_buf += u;
  2209. X          left -= u;
  2210. X          
  2211. X          return res;
  2212. X      }
  2213. X     
  2214. X     PanicIf ((res = malloc (u)) == NULL, "malloc failed");
  2215. X     return res;
  2216. X }
  2217. X
  2218. XFree (s) char *s;
  2219. X {
  2220. X    /* free (s);    */
  2221. X }
  2222. END_OF_FILE
  2223. if test 966 -ne `wc -c <'source/save.c'`; then
  2224.     echo shar: \"'source/save.c'\" unpacked with wrong size!
  2225. fi
  2226. # end of 'source/save.c'
  2227. fi
  2228. if test -f 'source/str.h' -a "${1}" != "-c" ; then 
  2229.   echo shar: Will not clobber existing file \"'source/str.h'\"
  2230. else
  2231. echo shar: Extracting \"'source/str.h'\" \(159 characters\)
  2232. sed "s/^X//" >'source/str.h' <<'END_OF_FILE'
  2233. X/*
  2234. X * Copyright (C) Crispin Goswell 1987, All Rights Reserved.
  2235. X */
  2236. X
  2237. Xchar *strcat (), *strncat ();
  2238. Xint strcmp (), strncmp (), strlen (), strspn (), strcspn ();
  2239. END_OF_FILE
  2240. if test 159 -ne `wc -c <'source/str.h'`; then
  2241.     echo shar: \"'source/str.h'\" unpacked with wrong size!
  2242. fi
  2243. # end of 'source/str.h'
  2244. fi
  2245. if test -f 'source/trapezoid.c' -a "${1}" != "-c" ; then 
  2246.   echo shar: Will not clobber existing file \"'source/trapezoid.c'\"
  2247. else
  2248. echo shar: Extracting \"'source/trapezoid.c'\" \(1924 characters\)
  2249. sed "s/^X//" >'source/trapezoid.c' <<'END_OF_FILE'
  2250. X/*
  2251. X * Copyright (C) Rutherford Appleton Laboratory 1987
  2252. X * 
  2253. X * This source may be copied, distributed, altered or used, but not sold for profit
  2254. X * or incorporated into a product except under licence from the author.
  2255. X * It is not in the public domain.
  2256. X * This notice should remain in the source unaltered, and any changes to the source
  2257. X * made by persons other than the author should be marked as such.
  2258. X * 
  2259. X *    Crispin Goswell @ Rutherford Appleton Laboratory caag@uk.ac.rl.vd
  2260. X */
  2261. X#include "main.h"
  2262. X#include "graphics.h"
  2263. X#include "canon.h"
  2264. X
  2265. Xstatic int Xvalue (ax, ay, bx, by, cy) int ax, ay, bx, by, cy;
  2266. X {
  2267. X     return bx + (cy - by) * (ax - bx) / (float) (ay - by);
  2268. X }
  2269. X
  2270. Xvoid BitBltTrapezoid (to, lefttop, leftbottom, righttop, rightbottom, top, bottom, rop)
  2271. X    struct hardware *to;
  2272. X    DevicePoint lefttop, leftbottom, righttop, rightbottom;
  2273. X    int top, bottom, rop;
  2274. X {
  2275. X     int i, j, temp;
  2276. X     static int left [1024], right [1024];
  2277. X     
  2278. X     int     ltx = Xvalue (lefttop.dx,     lefttop.dy,     leftbottom.dx,     leftbottom.dy,     top),
  2279. X         rtx = Xvalue (righttop.dx,     righttop.dy,     rightbottom.dx, rightbottom.dy, top),
  2280. X         lbx = Xvalue (lefttop.dx,     lefttop.dy,     leftbottom.dx,     leftbottom.dy,     bottom),
  2281. X         rbx = Xvalue (righttop.dx,     righttop.dy,     rightbottom.dx, rightbottom.dy, bottom);
  2282. X     
  2283. X     if (ltx == lbx && rtx == rbx)
  2284. X      {
  2285. X          if (rtx < ltx)
  2286. X              temp = rtx, rtx = ltx, ltx = temp;
  2287. X          
  2288. X         BitBlt ((struct hardware *) NULL, to,
  2289. X             NewDevicePoint (0, 0), NewDevicePoint (ltx, top),
  2290. X             NewDevicePoint (rtx - ltx + 1, bottom - top + 1), rop);
  2291. X         
  2292. X         return;
  2293. X      }
  2294. X     
  2295. X     for (i = top, j = 0; i <= bottom; i++, j++)
  2296. X      {
  2297. X          int     lx = Xvalue (lefttop.dx,     lefttop.dy,     leftbottom.dx, leftbottom.dy,  i),
  2298. X             rx = Xvalue (righttop.dx,     righttop.dy,     rightbottom.dx,rightbottom.dy, i);
  2299. X         
  2300. X         if (rx < lx)
  2301. X             temp = rx, rx = lx, lx = temp;
  2302. X         
  2303. X         left [j] = lx; right [j] = rx;
  2304. X      }
  2305. X     BitBltBlob (to, top, bottom - top, left, right, single_rop [rop]);
  2306. X }
  2307. END_OF_FILE
  2308. if test 1924 -ne `wc -c <'source/trapezoid.c'`; then
  2309.     echo shar: \"'source/trapezoid.c'\" unpacked with wrong size!
  2310. fi
  2311. # end of 'source/trapezoid.c'
  2312. fi
  2313. echo shar: End of archive 1 \(of 18\).
  2314. cp /dev/null ark1isdone
  2315. MISSING=""
  2316. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  2317.     if test ! -f ark${I}isdone ; then
  2318.     MISSING="${MISSING} ${I}"
  2319.     fi
  2320. done
  2321. if test "${MISSING}" = "" ; then
  2322.     echo You have unpacked all 18 archives.
  2323.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2324. else
  2325.     echo You still need to unpack the following archives:
  2326.     echo "        " ${MISSING}
  2327. fi
  2328. ##  End of shell archive.
  2329. exit 0
  2330.